home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / After Effects 3.1 SDK Mac / Examples / Header Files / PIFormatT.h < prev   
Text File  |  1996-06-13  |  10KB  |  321 lines

  1. /** PIFormatT.h
  2.     
  3.     This file describes the time extensions to Adobe's FFM interface.
  4.  
  5.     Part of the Adobe After Effects 3.1 SDK.
  6.     Copyright (c) 1992-96 Adobe Systems Inc.
  7.     All Rights Reserved.
  8.     
  9.     version 1.1    Clears out the outspec from the platform_info field if you specify a null name then the 
  10.                 location will be undefined.
  11.                     
  12. **/
  13.  
  14. #ifndef __PIFormatT__
  15. #define __PIFormatT__
  16.  
  17. #include "PIFormat.h"
  18. #include "FIEL_Public.h"
  19.  
  20.  
  21.  
  22. #define     PI_FORMAT_T_VERSION            1
  23. #define     PI_FORMAT_T_SUB_VERSION        1
  24.  
  25. // dimensions of an image when the options
  26. // is meant to be a template and not the
  27. // real thing
  28.  
  29. #define        PI_FORMAT_T_TPL_X            1
  30. #define     PI_FORMAT_T_TPL_Y            1
  31.  
  32.  
  33. enum {
  34.     PIModFlag_NONE = 0,
  35.     PIModFlag_INPUT = (1L<<0),                        // input module
  36.     PIModFlag_OUTPUT = (1L<<1),                        // output module (can be both)
  37.     PIModFlag_FILE = (1L<<2),                        // direct correspondence to file in file system
  38.     PIModFlag_STILL = (1L<<3),                        // still image support (not VIDEO)
  39.     PIModFlag_VIDEO = (1L<<4),                        // multiple image support (not STILL)
  40.     PIModFlag_NO_TIME = (1L<<5),                    // time-independent frame-store? always true if STILL; PICS example of non-STILL one
  41.     PIModFlag_INTERACTIVE_GET = (1L<<6),            // user interaction for new seq, required if !FILE & INPUT
  42.     PIModFlag_INTERACTIVE_PUT = (1L<<7),            // user interaction for new out, required if !FILE & OUTPUT
  43.     PIModFlag_MUST_INTERACT_PUT = (1L<<8),            // opts dialog box can't be avoided, even if revertInfo available
  44.     PIModFlag_CAN_ADD_FRAMES_NON_LINEAR = (1L<<9),    // AddFrame can handle non-sequential times
  45.     PIModFlag_NO_OUTPUT_OPTIONS = (1L<<10)            // Options calling sequence does not do anything
  46. };
  47.  
  48.  
  49. typedef struct FormatFlags
  50.     {
  51.     short    version;
  52.     short    subVersion; 
  53.     long    flags0;            /* Use PIModFlag here! */
  54.     long    flags1;            /* reserved -- set to 0 for now */
  55.     long    signature;
  56.     }
  57. FormatFlags;
  58.  
  59.  
  60.  
  61.  
  62. #define     PI_FORMAT_T_MESSAGE_LEN        127
  63. #define     PI_FORMAT_T_NAME_LEN        31
  64.  
  65.  
  66. #define        PIAlphaLabel_VERSION        0x0101        
  67.  
  68. #define        PIAlphaTag                    'ALFA'
  69. #define        PIAlphaResID                128
  70.  
  71.  
  72. enum {
  73.     formatSelectorSetupPrepare         =      formatSelectorWriteFinish + 1,
  74.     formatSelectorSetupStart,
  75.     formatSelectorSetupContinue,
  76.     formatSelectorSetupFinish,
  77.     
  78.     formatSelectorSetdownPrepare,
  79.     formatSelectorSetdownStart,
  80.     formatSelectorSetdownContinue,
  81.     formatSelectorSetdownFinish,
  82.  
  83.     formatSelectorStartAddPrepare,
  84.     formatSelectorStartAddStart,
  85.     formatSelectorStartAddContinue,
  86.     formatSelectorStartAddFinish,
  87.     
  88.     formatSelectorEndAddPrepare,
  89.     formatSelectorEndAddStart,
  90.     formatSelectorEndAddContinue,
  91.     formatSelectorEndAddFinish
  92.  
  93. };
  94.  
  95. enum {
  96.     PIAlpha_STRAIGHT,
  97.     PIAlpha_PREMUL,
  98.     PIAlpha_IGNORE,
  99.     PIAlpha_NONE
  100.  
  101. };
  102. typedef unsigned char PIAlphaType;    // this type is not really used, but you're welcome to
  103.  
  104.  
  105. enum {
  106.     PIAlphaPremul         = 0x1,        // otherwise straight
  107.     PIAlphaInverted        = 0x2        //  255 = transparent
  108. };
  109.  
  110. typedef unsigned long    PIAlphaFlags;
  111.  
  112. typedef struct {
  113.     short                    version;
  114.     PIAlphaFlags            flags;
  115.     unsigned char            red;            // color that was matted (if premul)
  116.     unsigned char            green;
  117.     unsigned char            blue;
  118.     PIAlphaType                alpha;
  119.     
  120. } PIAlphaLabel;
  121.  
  122.  
  123.  
  124. typedef struct PITimeRecord
  125.     {
  126.         long                value;
  127.         unsigned long        scale;
  128.     }
  129. PITimeRecord;
  130.  
  131.  
  132.  
  133. typedef struct TimeInfo
  134.     {
  135.         long            time_info_version;                                // hi word is major, lo is sub
  136.  
  137.         
  138.         /* info returned from all selectors */
  139.         
  140.         char            error_msg[PI_FORMAT_T_MESSAGE_LEN+1];            // set to non-null string
  141.                                                                         // when *result is an error code
  142.                                                                         // and the host will bring up an alert
  143.                                                                         // dialog
  144.             
  145.         /*    info returned on the first read */
  146.         
  147.         PITimeRecord    duration;            // duration of the footage
  148.         PITimeRecord    poster_time;        // time-record for "thumbnail"
  149.         Fixed            fixed_fps;            // frames per sec in fixed-point
  150.         
  151.         char            read_name[PI_FORMAT_T_NAME_LEN+1];
  152.         char            read_message[PI_FORMAT_T_MESSAGE_LEN+1];
  153.                                             // use this for compressor info, etc.
  154.  
  155.         long            start_smpte_frames;
  156.         short            time_base;                    // 24, 25, 30, or -30 for dropframe
  157.         char            reel_name[16];
  158.  
  159.  
  160.         /*    info sent to all reads */
  161.  
  162.         PITimeRecord    read_time;            // return a frame at this time
  163.         PITimeRecord    read_dur;            // the "shutter duration" of the read
  164.         Rect            read_rect;            // the host's "desired" region of the image
  165.         
  166.         
  167.  
  168.         /*    info sent back from options sequence */
  169.         
  170.         char            write_name[PI_FORMAT_T_NAME_LEN+1];
  171.         char            write_message[PI_FORMAT_T_MESSAGE_LEN+1];
  172.         
  173.         /*    info sent to all writes */
  174.         
  175.         Fixed            write_fixed_fps;    // frame rate of output
  176.         PITimeRecord    write_duration;        // maximum possible duration for this output (could be shorter)
  177.         
  178.         long            frame_num_to_add;    // which frame is being added (-1 for next)
  179.         long            frames_to_add;        // how many frames does this sample last?
  180.         Boolean            was_compressed;        // data has already been compressed/decompressed 
  181.         long            origin_h;            // ignored
  182.         long            origin_v;            // ignored
  183.         
  184.         PIAlphaLabel    alpha_label;        // alpha information for pixel data sent to write
  185.         FIEL_Label        interlace_label;    // interlace information for write data
  186.     }
  187. TimeInfo, *TimeInfoPtr, **TimeInfoHandle;
  188.  
  189.  
  190.  
  191. typedef struct TimeExtension
  192.     {
  193.     long                time_selector;        /*     this value is the FXIF plug-in selector.
  194.                                                 When the selector parameter to the plug-in's
  195.                                                 entry point is 0, check this value for the
  196.                                                 FXIF selector value. Otherwise, use the
  197.                                                 regular selector value*/
  198.     TimeInfoHandle        time_info;            
  199.     }
  200. TimeExtension;
  201.  
  202.  
  203. typedef struct FormatRecordT
  204.     {
  205.     TimeExtension        time_ext;        /* After Effects Time Extension to 8BIF */
  206.     
  207.                                         /* the remainder of this structure is identical to
  208.                                             the FormatRecord in Photoshop's 8BIF specification */
  209.     
  210.     long                serialNumber;    /* Host's serial number, to allow
  211.                                            copy protected plug-in modules. */
  212.  
  213.     TestAbortProc        abortProc;        /* The plug-in module may call this no-argument
  214.                                            BOOLEAN function (using Pascal calling
  215.                                            conventions) several times a second during long
  216.                                            operations to allow the user to abort the operation.
  217.                                            If it returns TRUE, the operation should be aborted
  218.                                            (and a positive error code returned). */
  219.  
  220.     ProgressProc        progressProc;    /* The plug-in module may call this two-argument
  221.                                            procedure (using Pascal calling conventions)
  222.                                            periodically to update a progress indicator.
  223.                                            The first parameter (type LONGINT) is the number
  224.                                            of operations completed; the second (type LONGINT)
  225.                                            is the total number of operations. */
  226.  
  227.     int32                maxData;        /* Maximum number of bytes that should be
  228.                                            passed back at once, plus the size of any
  229.                                            interal buffers. The plug-in may reduce this
  230.                                            value in the formatSelectorPrepare routine. */
  231.  
  232.     int32                minDataBytes;    /* Disk space needed for the data fork. */
  233.     int32                maxDataBytes;    /* Disk space needed for the data fork. */
  234.  
  235.     int32                minRsrcBytes;    /* Disk space needed for the resource fork. */
  236.     int32                maxRsrcBytes;    /* Disk space needed for the resource fork. */
  237.  
  238.     int32                dataFork;        /* refnum for the data fork. */
  239.     int32                rsrcFork;        /* refnum for the resource fork. */
  240.     
  241.     FSSpec *            fileSpec;        /* Full file specification. */
  242.  
  243.     short                imageMode;        /* Image mode */
  244.     Point                imageSize;        /* Size of image */
  245.     short                depth;            /* Bits per sample, currently must be 1 or 8 */
  246.     short                planes;         /* Samples per pixel */
  247.  
  248.     Fixed                imageHRes;        /* Pixels per inch */
  249.     Fixed                imageVRes;        /* Pixels per inch */
  250.  
  251.     LookUpTable            redLUT;         /* Red LUT, only used for Indexed Color images */
  252.     LookUpTable            greenLUT;        /* Green LUT, only used for Indexed Color images */
  253.     LookUpTable            blueLUT;        /* Blue LUT, only used for Indexed Color images */
  254.  
  255.     void *                data;            /* A pointer to the returned image data. The
  256.                                            plug-in module is responsible for freeing
  257.                                            this buffer. Should be set to NIL when
  258.                                            all the image data has been returned. */
  259.  
  260.     Rect                theRect;        /* Rectangle being returned */
  261.     short                loPlane;        /* First plane being returned */
  262.     short                hiPlane;        /* Last plane being returned */
  263.     short                colBytes;        /* Spacing between columns */
  264.     long                rowBytes;        /* Spacing between rows */
  265.     long                planeBytes;     /* Spacing between planes (ignored if only one
  266.                                            plane is returned at a time) */
  267.     PlaneMap            planeMap;        /* Maps plug-in plane numbers to host plane
  268.                                            numbers.  The host initializes this is a linear
  269.                                            mapping.  The plug-in may change this mapping if
  270.                                            it sees the data in a different order. */
  271.  
  272.     Boolean             canTranspose;    /* Is the host able to transpose the image? */
  273.     Boolean             needTranspose;    /* Does the plug-in need the image transposed? */
  274.  
  275.     OSType                hostSig;        /* Creator code for host application */
  276.     HostProc            hostProc;        /* Host specific callback procedure */
  277.  
  278.     short                hostModes;        /* Used by the host to inform the plug-in which
  279.                                            imageMode values it supports.  If the corresponding
  280.                                            bit (LSB = bit 0) is 1, the mode is supported. */
  281.  
  282.     Handle                revertInfo;     /* Information to be kept with the document for reverting or
  283.                                            saving.    Where possible this handle should be used to
  284.                                            avoid bringing up an options dialog. */
  285.  
  286.     NewPIHandleProc        hostNewHdl;     /* Handle allocation and disposal for revert info. */
  287.     DisposePIHandleProc    hostDisposeHdl;
  288.     
  289.     Handle                imageRsrcData;    /* Handle containing the block of resource data. */
  290.     int32                imageRsrcSize;    /* size of image resources. */
  291.  
  292.     PlugInMonitor        monitor;        /* The host's monitor. */
  293.  
  294.     void *                platformData;    /* Platform specific information. */
  295.  
  296.     BufferProcs *        bufferProcs;    /* The procedures for allocating and */
  297.                                         /* releasing buffers. */
  298.                                         
  299.     ResourceProcs *        resourceProcs;    /* Plug-in resource procedures. */
  300.  
  301.     ProcessEventProc    processEvent;    /* Pass event to the application. */
  302.     
  303.     DisplayPixelsProc    displayPixels;    /* Display dithered pixels. */
  304.  
  305.     HandleProcs            *handleProcs;    /* Platform independent handle manipulation. */
  306.  
  307.     OSType                fileType;        /* File-type for filtering */
  308.  
  309.     ColorServicesProc    colorServices; /* Routine to access color services. */
  310.     
  311.     AdvanceStateProc    advanceState;    /* Valid from continue selectors. */
  312.  
  313.     char                reserved [236]; /* Set to zero */
  314.  
  315.     }
  316. FormatRecordT, *FormatRecordTPtr;
  317.  
  318.  
  319.  
  320. #endif
  321.